/**
 * 
 * If you have edited the file, please update
 * all the last-modified fields manually. Thanks!
 *
 * @last-modified by: 
 * @last-modified date: 
 * @last-modified time: 
 *
 * @author Swee Zhi
 * @date-created Sep 12, 2011    @time-created 6:57:41 PM
 *
 * @project: 
 * @module: 
 * @institution: 
 *
 */
package util.enumhelper;

import util.enumeration.Language;
import util.enumeration.PriceRange;

public class LocalizedPriceRange {

    // alphabetical order
    public static String getLocalizedPriceRangeAsString(PriceRange priceRange, String locale) {
        String localizedPriceRange = "";
        
        // en_US ENGLISH, UNITED STATES
        if (locale.equals(SupportedLocale.getSupportedLocaleStringByLanguage(Language.ENGLISH_US))) {
            localizedPriceRange = getPriceRange_EN_US(priceRange);
        }
        // en_SG ENGLISH, SINGAPORE
        else
        if (locale.equals(SupportedLocale.getSupportedLocaleStringByLanguage(Language.ENGLISH_SINGAPORE))) {
            localizedPriceRange = getPriceRange_EN_SG(priceRange);
        }
        // ms_MY MALAY, MALAYSIA
        else
        if (locale.equals(SupportedLocale.getSupportedLocaleStringByLanguage(Language.MALAY))) {
            localizedPriceRange = getPriceRange_MS_MY(priceRange);
        }
        
        // zh_CN CHINESE, CHINA
        else
        if (locale.equals(SupportedLocale.getSupportedLocaleStringByLanguage(Language.CHINESE_CHINA))) {
            localizedPriceRange = getPriceRange_ZH_CN(priceRange);
        }
        // other language...
        else {
            localizedPriceRange = getPriceRange_EN_US(priceRange);
        }
        
        return localizedPriceRange;
    }
    
    // simplified chinese (zh_CN)
    private static String getPriceRange_ZH_CN(PriceRange priceRange) {
        String localizedPriceRange = "";
        
        switch (priceRange) {
            case LESSTHAN$20: localizedPriceRange = "低于二十新元" ; break; 
            case $20to$40: localizedPriceRange = "二十新元 至 四十新元"; break;
            case $41to$60: localizedPriceRange = "四十一新元 至 六十新元"; break;
            case $61to$80: localizedPriceRange = "六十一新元 至 八十新元"; break;
            case MORETHAN$100: localizedPriceRange = "高于一百新元"; break;
        }
        return localizedPriceRange;
    }
    
    // default (en_US)
    private static String getPriceRange_EN_US(PriceRange priceRange) {
        String localizedPriceRange = "";
        
        switch (priceRange) {
            case LESSTHAN$20: localizedPriceRange = "LESS THAN $20" ; break;
            case $20to$40: localizedPriceRange = "$20 to $40"; break;
            case $41to$60: localizedPriceRange = "$41 to $60"; break;
            case $61to$80: localizedPriceRange = "$61 to $80"; break;
            case MORETHAN$100: localizedPriceRange = "MORE THAN $100"; break;
        }
        return localizedPriceRange;
    }
    
    // singapore english (en_SG)
    private static String getPriceRange_EN_SG(PriceRange priceRange) {
        String localizedPriceRange = "";
        
        switch (priceRange) {
            case LESSTHAN$20: localizedPriceRange = "LESS THAN $20" ; break;
            case $20to$40: localizedPriceRange = "$20 to $40"; break;
            case $41to$60: localizedPriceRange = "$41 to $60"; break;
            case $61to$80: localizedPriceRange = "$61 to $80"; break;
            case MORETHAN$100: localizedPriceRange = "MORE THAN $100"; break;
        }
        return localizedPriceRange;
    }
    
    // bahasa malaysia (ms_MY)
    private static String getPriceRange_MS_MY(PriceRange priceRange) {
        String localizedPriceRange = "";
        
        switch (priceRange) {
            case LESSTHAN$20: localizedPriceRange = "kurang daripada 20 dolar" ; break;
            case $20to$40: localizedPriceRange = "20 hingga 40 dolar"; break;
            case $41to$60: localizedPriceRange = "41 hingga 60 dolar"; break;
            case $61to$80: localizedPriceRange = "61 hingga 80 dolar"; break;
            case MORETHAN$100: localizedPriceRange = "lebih daripada 100 dolar"; break;
        }
        return localizedPriceRange;
    }
    
    
    // new pricerange for localized language template (copy and paste to use)
//    private static String getPriceRange_XX_XX(PriceRange priceRange) {
//        String localizedPriceRange = "";
        
//        switch (priceRange) {
//            case LESSTHAN$20: localizedPriceRange = "kurang daripada 20 dolar" ; break;
//            case $20to$40: localizedPriceRange = "20 hingga 40 dolar"; break;
//            case $41to$60: localizedPriceRange = "41 hingga 60 dolar"; break;
//            case MORETHAN$100: localizedPriceRange = "lebih daripada 100 dolar"; break;
//        }
//        return localizedPriceRange;
//    }
    
}
